package com.ccf.business.etl.model.neo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;


@ApiModel(value = "图谱关系对象")
@Accessors(chain = true)
@Data
public class NeoRelation {
    @ApiModelProperty(value = "图谱关系ID")
    private String id;

    @ApiModelProperty(value = "图谱模型")
    private String model= "event";

    @ApiModelProperty(value = "图谱关系名称")
    private String name;

    @ApiModelProperty(value = "图谱起始节点ID")
    private String source;

    @ApiModelProperty(value = "图谱目标节点ID")
    private String target;

    @ApiModelProperty(value = "图谱关系样式")
    private NeoStyle style;

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (this == obj) {
            return true;
        }

        if (obj instanceof NeoRelation) {
            NeoRelation vo = (NeoRelation) obj;
            return vo.getId().equals(this.getId());
        }

        return false;
    }

    @Override
    public int hashCode() {
        return getId().hashCode();
    }
}
